package com.example.qihuibao.widget.dialog

import android.widget.Button
import android.widget.EditText
import com.example.qihuibao.R
import com.example.qihuibao.base.BaseDialogFragment

/**
 *@author: cww
 *@desc:修改单个值的对话框
 *@date: 5/16/23 10:58 AM
 */
class GetInputPwdDialog(val valueBack:(value:String)->Unit) : BaseDialogFragment(R.layout.dialog_get_input_pwd) {

    override fun initView() {
//        mView?.findViewById<TextView>(R.id.tv_title)?.text = title
//        mView?.findViewById<EditText>(R.id.et_value)?.text = Editable.Factory.getInstance().newEditable(default)
        mView?.findViewById<Button>(R.id.btn_cancel)?.setOnClickListener { dismiss() }
        mView?.findViewById<Button>(R.id.btn_ok)?.setOnClickListener { dismiss(); setValue() }
    }

    private fun setValue() {
        valueBack(mView?.findViewById<EditText>(R.id.et_value)?.text.toString())
    }

}